﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GS_OM.Pages
{
    public partial class Uploads : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            if (Session["SID"] == null) Response.Write("<script>window.parent.location.href='Login.aspx'</script>");
            HttpPostedFile FileImg1 = Request.Files["FileUpImg1"];
            HttpPostedFile FileImg2 = Request.Files["FileUpImg2"];
            HttpPostedFile FileImg3 = Request.Files["FileUpImg3"];
            HttpPostedFile FileImg4 = Request.Files["FileUpImg4"];
            if (FileImg1 != null && FileImg1.FileName.Trim() != "")
                Response.Write("<script>window.parent.uploadSuccessImg('1|" + Communal.UploadImg(this, FileImg1) + "');</script>");
            if (FileImg2 != null && FileImg2.FileName != "")
                Response.Write("<script>window.parent.uploadSuccessImg('2|" + Communal.UploadImg(this, FileImg2) + "');</script>");
            if (FileImg3 != null && FileImg3.FileName != "")
                Response.Write("<script>window.parent.uploadSuccessImg('3|" + Communal.UploadImg(this, FileImg3) + "');</script>");
            if (FileImg4 != null && FileImg4.FileName != "")
                Response.Write("<script>window.parent.uploadSuccessImg('4|" + Communal.UploadImg(this, FileImg4) + "');</script>");
        }
    }
}